#include("../../comm/FormHead.html")
<div id="main">
    <form action="" class="layui-form margin-10" lay-filter="form">
        <input type="hidden" id="actions" name="actions" value="#(form.actions)">
        #(token??)

        <div class="layui-row">
            <div class="layui-col-md12">
                <div class="layui-form-item">
                    <label class="layui-form-label">文件ID</label>

                    <div class="layui-input-block">
                        <input type="text" readonly name="file_id"
                               placeholder="自动生成" value="#(files.file_id)" class="layui-input input-readonly">
                    </div>
                </div>
            </div>
        </div>
        <div class="layui-row">
            <div class="layui-col-md12">
                <div class="layui-form-item">
                    <label class="layui-form-label">文件名</label>

                    <div class="layui-input-block">
                        <input type="text" name="file_name" placeholder="请输入文件名"
                               value="#(files.file_name)" class="layui-input">
                    </div>
                </div>
            </div>
        </div>
        <div class="layui-row">
            <div class="layui-col-md12">
                <div class="layui-form-item">
                    <label class="layui-form-label">扩展名</label>

                    <div class="layui-input-block">
                        <input type="text" name="file_ext" placeholder="请输入文件扩展名"
                               value="#(files.file_ext)" class="layui-input">
                    </div>
                </div>
            </div>
        </div>
        <div class="layui-row">
            <div class="layui-col-md12">
                <div class="layui-form-item">
                    <label class="layui-form-label">路经</label>

                    <div class="layui-input-block">
                        <input type="text" name="file_path" id="file_path" placeholder="请输入路经"
                               value="#(files.file_path)" class="layui-input">
                    </div>
                </div>
            </div>
        </div>
        <div class="layui-row">
            <div class="layui-col-md12">
                <div class="layui-form-item">
                    <label class="layui-form-label">文件备注</label>

                    <div class="layui-input-block">
                        <textarea name="file_desc" placeholder="请输入备注信息" class="layui-textarea" style="height:180px">#(files.file_desc)</textarea>
                    </div>
                </div>
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-input-block">
                <button type="submit" class="layui-btn" lay-submit="" lay-filter="Submit1">立即提交</button>
                <button type="reset" class="layui-btn layui-btn-primary">重置</button>
            </div>
        </div>
    </form>
</div>
<SCRIPT LANGUAGE="JavaScript">
    <!--
    var $ = layui.$;
    layui.use('upload', function () {
        layui.upload.render({
            elem: '#imagebtn1', url: 'UploadImages', size: 300, accept: 'image', exts: 'jpg|gif|png'
            , done: function (res) {
                if (res.code == 0) {
                    $('#image1').attr('src', res.object.view_path);
                    $('#file_path').val(res.object.save_path);
                    return layer.msg('上传成功');
                } else {
                    return layer.msg('上传失败');
                }
            }
        });
    });
    layui.use(['form', 'myTool'], function () {
        layui.form.on('submit(Submit1)', function (data) {
            layui.myTool.post("ModifySysFileApi", {postdata: JSON.stringify(data.field)}, function () {
                parent.layer.closeAll();
            });
            return false;
        });
    });
    //-->
</SCRIPT>
</body>
</html>